package Supermarket;

import java.util.ArrayList;
import java.util.Scanner;

public class SupermarketTest {
    public static void main(String[] args){
        /*Goods[] goods=new Goods[10];
        goods[0]=new Vegetable(true,"黄瓜",10);
        goods[1]=new meat("排骨",35);
        System.out.print("菜名\t价格\t是否当天\n");
        for(int i=0;i< goods.length;i++){
             if(goods[i] instanceof Vegetable){
                 Vegetable vegetable
             }
        }
        System.out.println();
        System.out.print("肉名\t价格\n");
        System.out.println(goods[1].name+"\t"+goods[1].price);*/
        /*ArrayList<Vegetable> vegetables=new ArrayList<>();
        vegetables.add(0,new Vegetable(true,"黄瓜",10));
        vegetables.get(0).discount();

        Goods[] goods=new Goods[10];
        goods[0]=new Vegetable(false,"大白菜",2);
        goods[1]=new meat("猪排骨",32);
        goods[2]=new Vegetable(false,"黄瓜",4);
        goods[3]=new Vegetable(false,"土豆",5);
        goods[4]=new Vegetable(false,"丝瓜",12);
        goods[5]=new Vegetable(false,"茄子",8);
        goods[6]=new meat("牛肉",50);
        goods[7]=new meat("羊排",68);
        goods[8]=new meat("猪大肠",16);
        goods[9]=new meat("鸡翅",25);
        for (Goods good : goods) {
            if (good instanceof Vegetable) {
                Vegetable vegetable=(Vegetable)good;
                System.out.println(vegetable.name+"\t"+vegetable.price+"\t"+ vegetable.today);
            }else {
                System.out.println(good.name+"\t"+good.price);
            }

        }
System.out.println();
         */
        /*for (Goods good : goods) {
            if (good instanceof Vegetable) {
                Vegetable vegetable = (Vegetable) good;
                vegetable.discount();
                System.out.println(vegetable.name+"\t"+vegetable.price+"\t"+ vegetable.today);
            }
            else if(good instanceof meat){
                meat meat = (meat) good;
                meat.discount();
                System.out.println(good.name+"\t"+good.price);
            }
        } */
        /*for (Goods good : goods) {
            ((Discount) good).discount();//////////////////////////////////
            if (good instanceof Vegetable) {
                Vegetable vegetable=(Vegetable)good;
                System.out.println(vegetable.name+"\t"+vegetable.price+"\t"+ vegetable.today);
            }else {
                System.out.println(good.name+"\t"+good.price);
            }
        }
         */

        AddGoods addGoods=new AddGoods();
        addGoods.AddV();
        addGoods.AddM();
    }
}
